import 'package:card_swiper/card_swiper.dart';
import 'package:flutter/material.dart';

/// 轮播图工具类
AspectRatio defaultSwiperWidget(List<String> imgList, {double aspectRatio = 2 / 1}) {
  return AspectRatio(
    aspectRatio: aspectRatio,
    child: Swiper(
        itemBuilder: (BuildContext context, int index) {
          return Image.network(
            imgList[index],
            fit: BoxFit.fill,
          );
        },
        itemCount: imgList.length,
        loop: true,
        autoplay: true,
        pagination: const SwiperPagination(builder: SwiperPagination())),
  );
}
